<template>
  <Tabs :value="itemData.value"
        :type="itemData.type"
        @on-click="tabsHandleChange">
    <TabPane v-for="(item, index) in itemData.tabs"
             :key="index"
             :label="item.label"
             :name="item.name"></TabPane>
  </Tabs>
</template>
<script>
    export default {
        props: {
            itemData: {
                type: Object
            }
        },
        data () {
            return {

            }
        },
        created () {},
        methods: {
            // 获取tabs信息
            tabsHandleChange (key) {
                let obj = {};
                this.itemData.tabs.forEach(item => {
                    if (item.name === key) {
                        obj = item
                    }
                });

                this.$emit('tabsHandleChange', obj);
            }
        }
    }
</script>
